package com.richard.base.net.utils

import com.richard.base.net.common.Preference


/**
 * **************************************
 * 项目名称:凯叔讲故事
 *
 * @Author Whg
 * 邮箱：guanhuawei@ksjgs
 * 创建时间: 2019-12-24     16:45
 * 修改时间: 2019-12-24     16:45
 * 描述：数据上报时间容错工具类
 * **************************************
 */
object DiffTimeUtils {
    var bDiffTimeAdjusted = false
    const val DIFFHOURADJUST = 30 * 60 * 1000 //30分鐘
    var pointDiffTimeMs: Long = 0
    var temp by Preference("servertimediff",0L)

    @JvmStatic
    var diffMs: Long
        get() = if (bDiffTimeAdjusted) {
            pointDiffTimeMs
        } else temp
        set(diffms) {
            bDiffTimeAdjusted = true
            pointDiffTimeMs = diffms
            temp = pointDiffTimeMs
        }
}